#include <iostream>
#include <cstring>
using namespace std;
using ll=long long;
int vis[26];
string str;
ll al(int x)
{
	if(x==0)
		return 0;
		
	memset(vis,0,sizeof(vis));
	int cnt=0;
	int left=0,right=0;
	ll ret=0;
	while(right<str.size())
	{
		if(vis[str[right]-'a']++==0)
			cnt++;
		while(cnt>x && left<=right)
		{
			if(--vis[str[left]-'a']==0)
				cnt--;
			left++;
		}
		ret+=right-left+1;
		right++;
	}
	return ret;
}
int main()
{
	int n,l,r;
	cin>>n>>l>>r;
	
	
	cin>>str;
	cout<<al(r)-al(l-1)<<endl;
	return 0;
}


// ab aba ba
